For the users' privacy security in electronic transactions, an electronic transaction scheme was proposed to protect the users' privacy. The scheme combined the oblivious transfer and ElGamal signature, achieved both traders privacy security in electronic transactions. A user used a serial number to choose digital goods and paid the bank anonymously and correctly. After that, the bank sent a digital signature of the digital goods to the user, then the user interacted with the merchant obliviously through the digital signature that he had paid. The user got the key though the number of exponentiation encryption, the merchant could not distinguish the digital goods ordered. The serial number was concealed and restricted, so the user could not open the message with the unselected serial number, they could and only could get the digital goods they paid. Correctness proof and security analysis shows that the proposed scheme can protect both traders mutual information in electronic transactions and prevent merchant's malicious fraud. The scheme has short signature, small amount of calculation and dynamic changed keys, its security is strong.